/**
 * 是否为空
 * @param value
 * @param nullValue
 * @returns {boolean}
 */
import {trim} from "./trim";
import {equals} from "./equals";

function isEmpty(value, nullValue?) {
  if (null == value || undefined == value || 0 == value) {
    return true;
  } else if (toString.call(value) === '[object ArrayBuffer]') {
    return value.length == 0;
  } else {
    let tmp = trim(value);
    if (tmp == "") {
      return true;
    } else {
      return equals(value, nullValue);
    }
  }
}

export {isEmpty}
